#pragma once

#include <string>
#include <sstream>
#include <tchar.h>
#include <exception>

class wexception : public std::exception
{
private:
	std::wstring _errMsg;

public:
	wexception(const std::wstring& errMsg)
		: _errMsg(errMsg)
	{
	}

	const wchar_t* what() 
	{
		return _errMsg.c_str();
	}
};

#if defined UNICODE || defined _UNICODE
#define _tstring wstring
#define _tstringstream wstringstream
#define _tifstream wifstream
#define _tofstream wofstream
#define _texception wexception
#else
#define _tstring string
#define _tstringstream stringstream
#define _tifstream ifstream
#define _tofstream ofstream
#define _texception exception
#endif

